package cn.good.yan.controller.t3;

import cn.good.yan.service.t1.OrderService;
import cn.good.yan.service.t3.HyperloglogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 演示 - Redis - hyperloglog 基数统计
 *
 * @author shengren.yan
 * @create 2023-11-20
 */
@RestController
@RequestMapping("/t3")
@Slf4j
public class HyperloglogController {

    @Autowired
    private HyperloglogService hyperloglogService;

    /**
     * 访问 hyperloglog 的key 基数统计
     * @return {@link String}
     */
    @GetMapping("/list")
    public String addOrder(){
        long uv = hyperloglogService.uv();
        return "ok" + uv;
    }


}
